﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using Project.Engine.Utilities;
using System.Web.SessionState;
using Project.Module.DAO.CMSBL;

namespace Project.Module.Controller
{
    class CMSNewsController
    {
    }

    public partial class HomeController
    {
        public JsonResult AddNews(string title, string content, string status)
        {
            (new NewsBL()).AddNews(title, content, status);
            return Json(new { result = 1 }, JsonRequestBehavior.AllowGet);
        }

        public ActionResult DeleteNews(int id)
        {
            (new NewsBL()).DeleteNews(id);
            return Redirect("/admin/quan-ly-bai-viet");
        }

        public JsonResult EditNews(int id, string title, string content, string status)
        {
            (new NewsBL()).EditNews(id, title, content, status);
            return Json(new { result = 1 }, JsonRequestBehavior.AllowGet);
        }

    }
}
